﻿using Gp.Scripts.Core;
using UnityEngine;
using UnityEngine.UI;

namespace Gp.Scripts.GUI {
    public class ActionButton : MonoBehaviour {
        public Button button;
        public AudioClip clip;
        // public BehaviourMode behaviourMode;
        //
        // private ActionUIController _actionUIController;
        //
        // private void Update() {
        //     if (!_actionUIController.CurUnit) return;
        //     var isEnabled = false;
        //     if (_actionUIController == null && _actionUIController.CurUnit == null) return;
        //     isEnabled = _actionUIController.CurUnit.AbilityManager.IsAvailable(behaviourMode);
        //     button.interactable = isEnabled;
        // }
        //
        // private void Start() {
        //     _actionUIController = GetComponentInParent<ActionUIController>();
        //     button.onClick.AddListener(ButtonClick);
        // }
        //
        // private void ButtonClick() {
        //     var b = _actionUIController.CurUnit.AbilityManager;
        //     AudioSource.PlayClipAtPoint(clip, ObjectHelper.MainCamera!.transform.position, 1f);
        //     b.CurrentSelected = behaviourMode;
        //     b.SwitchToBehaviour();
        // }
    }
}